home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIXPCScriptable.idl < prev    next >
Text File  |  2006-05-08  |  8KB  |  176 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is Mozilla Communicator client code, released
  17.  * March 31, 1998.
  18.  *
  19.  * The Initial Developer of the Original Code is
  20.  * Netscape Communications Corporation.
  21.  * Portions created by the Initial Developer are Copyright (C) 1998
  22.  * the Initial Developer. All Rights Reserved.
  23.  *
  24.  * Contributor(s):
  25.  *   John Bandhauer <jband@netscape.com> (original author)
  26.  *
  27.  * Alternatively, the contents of this file may be used under the terms of
  28.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  29.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  30.  * in which case the provisions of the GPL or the LGPL are applicable instead
  31.  * of those above. If you wish to allow use of your version of this file only
  32.  * under the terms of either the GPL or the LGPL, and not to allow others to
  33.  * use your version of this file under the terms of the MPL, indicate your
  34.  * decision by deleting the provisions above and replace them with the notice
  35.  * and other provisions required by the GPL or the LGPL. If you do not delete
  36.  * the provisions above, a recipient may use your version of this file under
  37.  * the terms of any one of the MPL, the GPL or the LGPL.
  38.  *
  39.  * ***** END LICENSE BLOCK ***** */
  40.  
  41. #include "nsISupports.idl"
  42. #include "nsIXPConnect.idl"
  43.  
  44. %{ C++
  45. #define NS_SUCCESS_I_DID_SOMETHING \
  46.    (NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_XPCONNECT,1))
  47. %}
  48.  
  49. /**
  50.  * Note: This is not really an XPCOM interface.  For example, callers must
  51.  * guarantee that they set the *_retval of the various methods that return a
  52.  * boolean to PR_TRUE before making the call.  Implementations may skip writing
  53.  * to *_retval unless they want to return PR_FALSE.
  54.  */
  55.  
  56. [uuid(9cc0c2e0-f769-4f14-8cd6-2d2d40466f6c)]
  57. interface nsIXPCScriptable : nsISupports
  58. {
  59.     /* bitflags used for 'flags' (only 32 bits available!) */
  60.  
  61.     const PRUint32 WANT_PRECREATE                   = 1 <<  0;
  62.     const PRUint32 WANT_CREATE                      = 1 <<  1;
  63.     const PRUint32 WANT_POSTCREATE                  = 1 <<  2;
  64.     const PRUint32 WANT_ADDPROPERTY                 = 1 <<  3;
  65.     const PRUint32 WANT_DELPROPERTY                 = 1 <<  4;
  66.     const PRUint32 WANT_GETPROPERTY                 = 1 <<  5;
  67.     const PRUint32 WANT_SETPROPERTY                 = 1 <<  6;
  68.     const PRUint32 WANT_ENUMERATE                   = 1 <<  7;
  69.     const PRUint32 WANT_NEWENUMERATE                = 1 <<  8;
  70.     const PRUint32 WANT_NEWRESOLVE                  = 1 <<  9;
  71.     const PRUint32 WANT_CONVERT                     = 1 << 10;
  72.     const PRUint32 WANT_FINALIZE                    = 1 << 11;
  73.     const PRUint32 WANT_CHECKACCESS                 = 1 << 12;
  74.     const PRUint32 WANT_CALL                        = 1 << 13;
  75.     const PRUint32 WANT_CONSTRUCT                   = 1 << 14;
  76.     const PRUint32 WANT_HASINSTANCE                 = 1 << 15;
  77.     const PRUint32 WANT_MARK                        = 1 << 16;
  78.     const PRUint32 USE_JSSTUB_FOR_ADDPROPERTY       = 1 << 17;
  79.     const PRUint32 USE_JSSTUB_FOR_DELPROPERTY       = 1 << 18;
  80.     const PRUint32 USE_JSSTUB_FOR_SETPROPERTY       = 1 << 19;
  81.     const PRUint32 DONT_ENUM_STATIC_PROPS           = 1 << 20;
  82.     const PRUint32 DONT_ENUM_QUERY_INTERFACE        = 1 << 21;
  83.     const PRUint32 DONT_ASK_INSTANCE_FOR_SCRIPTABLE = 1 << 22;
  84.     const PRUint32 CLASSINFO_INTERFACES_ONLY        = 1 << 23;
  85.     const PRUint32 ALLOW_PROP_MODS_DURING_RESOLVE   = 1 << 24;
  86.     const PRUint32 ALLOW_PROP_MODS_TO_PROTOTYPE     = 1 << 25;
  87.     const PRUint32 DONT_SHARE_PROTOTYPE             = 1 << 26;
  88.     const PRUint32 DONT_REFLECT_INTERFACE_NAMES     = 1 << 27;
  89.     const PRUint32 WANT_EQUALITY                    = 1 << 28;
  90.     const PRUint32 WANT_OUTER_OBJECT                = 1 << 29;
  91.     const PRUint32 WANT_INNER_OBJECT                = 1 << 30;
  92.  
  93.     // The high order bit is RESERVED for consumers of these flags. 
  94.     // No implementor of this interface should ever return flags 
  95.     // with this bit set.
  96.     const PRUint32 RESERVED                         = 1 << 31;
  97.  
  98.     readonly attribute string   className;
  99.     readonly attribute PRUint32 scriptableFlags;
  100.  
  101.     void   preCreate(in nsISupports nativeObj, in JSContextPtr cx,
  102.                      in JSObjectPtr globalObj, out JSObjectPtr parentObj);
  103.  
  104.     void   create(in nsIXPConnectWrappedNative wrapper,
  105.                   in JSContextPtr cx, in JSObjectPtr obj);
  106.  
  107.     void   postCreate(in nsIXPConnectWrappedNative wrapper,
  108.                       in JSContextPtr cx, in JSObjectPtr obj);
  109.  
  110.     PRBool addProperty(in nsIXPConnectWrappedNative wrapper,
  111.                        in JSContextPtr cx, in JSObjectPtr obj, in JSVal id,
  112.                        in JSValPtr vp);
  113.  
  114.     PRBool delProperty(in nsIXPConnectWrappedNative wrapper,
  115.                        in JSContextPtr cx, in JSObjectPtr obj, in JSVal id,
  116.                        in JSValPtr vp);
  117.  
  118.     // The returnCode should be set to NS_SUCCESS_I_DID_SOMETHING if
  119.     // this method does something.
  120.     PRBool getProperty(in nsIXPConnectWrappedNative wrapper,
  121.                        in JSContextPtr cx, in JSObjectPtr obj, in JSVal id,
  122.                        in JSValPtr vp);
  123.  
  124.     // The returnCode should be set to NS_SUCCESS_I_DID_SOMETHING if
  125.     // this method does something.
  126.     PRBool setProperty(in nsIXPConnectWrappedNative wrapper,
  127.                        in JSContextPtr cx, in JSObjectPtr obj, in JSVal id,
  128.                        in JSValPtr vp);
  129.  
  130.     PRBool enumerate(in nsIXPConnectWrappedNative wrapper,
  131.                      in JSContextPtr cx, in JSObjectPtr obj);
  132.  
  133.     PRBool newEnumerate(in nsIXPConnectWrappedNative wrapper,
  134.                         in JSContextPtr cx, in JSObjectPtr obj,
  135.                         in PRUint32 enum_op, in JSValPtr statep, out JSID idp);
  136.  
  137.     PRBool newResolve(in nsIXPConnectWrappedNative wrapper,
  138.                       in JSContextPtr cx, in JSObjectPtr obj, in JSVal id,
  139.                       in PRUint32 flags, out JSObjectPtr objp);
  140.  
  141.     PRBool convert(in nsIXPConnectWrappedNative wrapper,
  142.                    in JSContextPtr cx, in JSObjectPtr obj,
  143.                    in PRUint32 type, in JSValPtr vp);
  144.  
  145.     void   finalize(in nsIXPConnectWrappedNative wrapper,
  146.                     in JSContextPtr cx, in JSObjectPtr obj);
  147.  
  148.     PRBool checkAccess(in nsIXPConnectWrappedNative wrapper,
  149.                        in JSContextPtr cx, in JSObjectPtr obj, in JSVal id,
  150.                        in PRUint32 mode, in JSValPtr vp);
  151.  
  152.     PRBool call(in nsIXPConnectWrappedNative wrapper,
  153.                 in JSContextPtr cx, in JSObjectPtr obj,
  154.                 in PRUint32 argc, in JSValPtr argv, in JSValPtr vp);
  155.  
  156.     PRBool construct(in nsIXPConnectWrappedNative wrapper,
  157.                      in JSContextPtr cx, in JSObjectPtr obj,
  158.                      in PRUint32 argc, in JSValPtr argv, in JSValPtr vp);
  159.  
  160.     PRBool hasInstance(in nsIXPConnectWrappedNative wrapper,
  161.                        in JSContextPtr cx, in JSObjectPtr obj,
  162.                        in JSVal val, out PRBool bp);
  163.  
  164.     PRUint32 mark(in nsIXPConnectWrappedNative wrapper,
  165.                   in JSContextPtr cx, in JSObjectPtr obj, in voidPtr arg);
  166.  
  167.     PRBool equality(in nsIXPConnectWrappedNative wrapper,
  168.                     in JSContextPtr cx, in JSObjectPtr obj, in JSVal val);
  169.  
  170.     JSObjectPtr outerObject(in nsIXPConnectWrappedNative wrapper,
  171.                             in JSContextPtr cx, in JSObjectPtr obj);
  172.  
  173.     JSObjectPtr innerObject(in nsIXPConnectWrappedNative wrapper,
  174.                             in JSContextPtr cx, in JSObjectPtr obj);
  175. };
  176.